package priv.hehe.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;

import priv.hehe.entry.Emplooy;
import priv.hehe.service.EmplooyService;

public class EmplooyHandler extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		resp.setContentType("text/html;charset=utf-8");
		EmplooyService emplooyService = new EmplooyService();
		try {
			List<Emplooy> selectAll = emplooyService.selectAll();
			resp.getWriter().print(JSON.toJSONString(selectAll));
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	
	
}
